package cn.edu.imau.zy.common.constant;

/****
 * 考试状态
 */
public  final class ExaminationConstant {

    public enum CorrectType {
        SYSTEM(1, "系统判分"), TEACHER(2, "教师判分"), SYSTEM_AND_TEACHER(3, "系统加教师判分");
        private Integer value;
        private String name;

        CorrectType(Integer value, String name) {
            this.value = value;
            this.name = name;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }
    /**
     * 是或者否
     */
    public enum Flag {
        YES(1, true), NO(0, false);
        private Integer value;
        private boolean flag;

        Flag(Integer value, boolean flag) {
            this.value = value;
            this.flag = flag;
        }

        public Integer getValue() {
            return value;
        }

        public boolean isFlag() {
            return flag;
        }
    }

    public enum CorrectStatus {
        ERROR(0, "错误"), RIGHT(1, "正确"), CORRECT_RUNNING(2, "待批改"), CORRECTED(3, "已批改");

        private Integer value;
        private String name;
        CorrectStatus(Integer value, String name) {
            this.name = name;
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }
    /**
     * 考试类型
     */
    public enum ExamType {
        ERROR_EXAM(1, "错题纠正考试"), GRADE_EXAM(2, "年级考试"), ENTRANCE_EXAM(3, "入学考试");
        private Integer value;
        private String name;

        ExamType(Integer value, String name) {
            this.name = name;
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    public enum QuestionType {
        SINGLE_QUESTION(1, "单选题"), MULTIPLE_QUESTION(2, "多选题"),
        FILL_QUESTION(3, "填空题"), SYNTHESIS_QUESTION(4, "综合题"),
        INDEFINITE_ITEM_QUESTION(5, "不定项题"),
        CALCULATION_QUESTION(7, "计算题"),
        JUDGMENT_QUESTION(6, "判断题");
        private Integer value;
        private String name;
        QuestionType(Integer value, String name) {
            this.name = name;
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }

        public static String getName(Integer type) {
            QuestionType questionTypes[] = values();
            for (QuestionType questionType : questionTypes) {
                if (questionType.getValue() == type) {
                    return questionType.getName();
                }
            }
            return null;
        }
    }

    public enum CommitAfterType {
        SHOW_MARK_AFTER_CORRECT(1, "批改后显示成绩"),
        SHOW_MARK_NOW(2, "提交立即显示成绩");

        private Integer value;
        private String name;

        CommitAfterType(Integer value, String name) {
            this.name = name;
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

}
